import Plants.PeaShooter;
import Zombies.Zombie;


public class World {
    public static void main(String[] args) {
        PeaShooter pea = new PeaShooter("豌豆射手",100, 2);
        Zombie zombie = new Zombie("普通僵尸",60, 2);
        for (int i = 1; i < 100; i++) {
            int live = zombie.getLive() - pea.getFire();
            System.out.println("植物发起了攻击,僵尸血量剩余:"+live);
            zombie.setLive(live);
            int pealive = pea.getLive() - zombie.getFire();
            System.out.println("僵尸发起了攻击,植物血量剩余:"+pealive);
            pea.setLive(pealive);
            if(zombie.getLive() == 0 || pea.getLive() ==0) {
                if (zombie.getLive() == 0) {
                    System.out.println(zombie.getName()+"死亡,游戏结束");
                    break;
                }
                else{
                    System.out.println(pea.getName()+"死亡,游戏结束");
                    break;
                }
            }
        }

    }
}
